home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.Sprite;
- import flash.events.Event;
-
- public class ItemManager extends Sprite
- {
-
-
- private var §\x01\x01\x02\t§:*;
-
- private var §\x01\x01\x02\r§:*;
-
- private var §\x01\x01\x07\x06§:* = null;
-
- private var §\x01\x01\x07\x07§:int;
-
- private var §\x01\x01\x06\r§:*;
-
- private var §\x01\x01\x02\x10§:*;
-
- private var §\x01\x01\x07\b§:String;
-
- private var §\x01\x01\x07\n§:int = 0;
-
- public function ItemManager(param1:*, param2:*, param3:*)
- {
- §\x01\x01\x07\x06§ = null;
- §\x01\x01\x07\n§ = 0;
- super();
- §\x01\x01\x02\t§ = param1;
- §\x01\x01\x06\r§ = param2.GetSceneContainer();
- §\x01\x01\x02\x10§ = param3;
- }
-
- public function StopGame() : *
- {
- if(§\x01\x01\x07\x06§ != null)
- {
- RemoveItem();
- }
- §\x01\x01\x02\t§.removeEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§);
- }
-
- public function StartGame() : *
- {
- §\x01\x01\x02\t§.addEventListener(Event.ENTER_FRAME,§\x01\x01\x06\x0e§,false,0,true);
- }
-
- private function §\x01\x01\x06\x0e§(param1:Event) : *
- {
- if(§\x01\x01\x07\t§())
- {
- if(§\x01\x01\x07\x06§ != null)
- {
- RemoveItem();
- }
- if(§\x01\x01\x02\x10§.GetKnightArmor() < 50)
- {
- §\x01\x01\x07\b§ = "armor";
- }
- else if(§\x01\x01\x02\x10§.GetKnightHealth() < 50)
- {
- §\x01\x01\x07\b§ = "health";
- }
- else if(§\x01\x01\x02\x10§.GetKnightArmor() >= 100 && §\x01\x01\x02\x10§.GetKnightHealth() >= 100)
- {
- §\x01\x01\x07\b§ = "speed";
- }
- else if(Math.random() < 0.2)
- {
- §\x01\x01\x07\b§ = "speed";
- }
- else if(Math.random() < 0.4)
- {
- §\x01\x01\x07\b§ = "health";
- }
- else if(Math.random() < 0.6)
- {
- §\x01\x01\x07\b§ = "armor";
- }
- else
- {
- §\x01\x01\x07\b§ = "full";
- }
- §\x01\x01\x07\x06§ = new item();
- §\x01\x01\x07\x06§.Init(§\x01\x01\x02\t§,§\x01\x01\x06\r§,this,§\x01\x01\x07\b§);
- §\x01\x01\x06\r§.addChild(§\x01\x01\x07\x06§);
- }
- }
-
- public function RemoveItem() : *
- {
- §\x01\x01\x06\r§.removeChild(§\x01\x01\x07\x06§);
- §\x01\x01\x07\x06§ = null;
- }
-
- private function §\x01\x01\x07\t§() : Boolean
- {
- if(§\x01\x01\x07\n§ <= 0)
- {
- §\x01\x01\x07\n§ = Math.round(20000 / 42);
- return true;
- }
- --§\x01\x01\x07\n§;
- return false;
- }
- }
- }
-